import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class node {
    public int value;
    public node left, right;

    public node(int val) {
        value = val;
        left = right = null;
    }

    public node(int value, node left, node right) {
        this.value = value;
        this.left = left;
        this.right = right;
    }
}

public class code1 {
    static node buildBalancedTree(ArrayList<Integer> arr, int start, int end) {
        if (start == end) return new node(arr.get(start));
        if (start > end) return null;
        int mid = start + ((end - start) >> 1);
        node root = new node(arr.get(mid));
        root.left = buildBalancedTree(arr, start, mid - 1);
        root.right = buildBalancedTree(arr, mid + 1, end);
        return root;
    }

    static ArrayList<Integer> splitStr(String str) {
        String[] strs = str.split(" ");
        int n = strs.length;
        ArrayList<Integer> arr = new ArrayList<>();
        for (int i = 0; i < n; ++i) {
            arr.add(Integer.parseInt(strs[i]));
        }
        return arr;
    }

    static String traversalTree(node root, int aim) {
        StringBuilder res = new StringBuilder("S");
        if (root == null) return res + "N";
        node cur = root;
        while (cur != null && cur.value != aim) {
            if (cur.value > aim) {
                res.append("L");
                cur = cur.left;
            } else if (cur.value < aim) {
                res.append("R");
                cur = cur.right;
            } else {
                break;
            }
        }
        if (cur == null) return res.substring(0, res.length() - 1) + "N";
        else return res + "Y";
    }

    static void test1() {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] tokens = str.split(",");
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aim;
        String str;
        str = sc.nextLine();
        aim = sc.nextInt();
        ArrayList<Integer> arr = splitStr(str);
        Collections.sort(arr);
        node root = buildBalancedTree(arr, 0, arr.size() - 1);
        System.out.println(traversalTree(root, aim));

//        test1();
    }
}
